diff --git a/swh/web/assets/src/bundles/browse/browse-utils.js b/swh/web/assets/src/bundles/browse/browse-utils.js
index 4568e5eb..54e0030d 100644
--- a/swh/web/assets/src/bundles/browse/browse-utils.js
+++ b/swh/web/assets/src/bundles/browse/browse-utils.js
@@ -1,97 +1,76 @@
/**
* Copyright (C) 2018 The Software Heritage developers
* See the AUTHORS file at the top-level directory of this distribution
* License: GNU Affero General Public License version 3, or any later version
* See top-level LICENSE file for more information
*/
-export function initBrowse(page) {
+$(document).ready(() => {
- $(document).ready(() => {
-
- $('.dropdown-submenu a.dropdown-item').on('click', e => {
- $(e.target).next('div').toggle();
- if ($(e.target).next('div').css('display') !== 'none') {
- $(e.target).focus();
- } else {
- $(e.target).blur();
- }
- e.stopPropagation();
- e.preventDefault();
- });
+ $('.dropdown-submenu a.dropdown-item').on('click', e => {
+ $(e.target).next('div').toggle();
+ if ($(e.target).next('div').css('display') !== 'none') {
+ $(e.target).focus();
+ } else {
+ $(e.target).blur();
+ }
+ e.stopPropagation();
+ e.preventDefault();
+ });
- // ensure branches/releases dropdowns are reparented to body to avoid
- // overflow issues
- $('#swh-branches-releases-dd').on('shown.bs.dropdown', function() {
- $('body').append($('#swh-branches-releases-dd').css({
- position: 'absolute',
- left: $('#swh-branches-releases-dd').offset().left,
- top: $('#swh-branches-releases-dd').offset().top
- }).detach());
- // ensure breadcrumbs stay at the same position
- let bcOffsetLeft = $('#swh-branches-releases-dd').offset().left +
+ // ensure branches/releases dropdowns are reparented to body to avoid
+ // overflow issues
+ $('#swh-branches-releases-dd').on('shown.bs.dropdown', function() {
+ $('body').append($('#swh-branches-releases-dd').css({
+ position: 'absolute',
+ left: $('#swh-branches-releases-dd').offset().left,
+ top: $('#swh-branches-releases-dd').offset().top
+ }).detach());
+ // ensure breadcrumbs stay at the same position
+ let bcOffsetLeft = $('#swh-branches-releases-dd').offset().left +
$('#swh-branches-releases-dd').width();
- let bcOffsetTop = $('.swh-browse-bread-crumbs').offset().top;
- $('.swh-browse-bread-crumbs').css('position', 'absolute');
- $('.swh-browse-bread-crumbs').offset({'left': bcOffsetLeft, 'top': bcOffsetTop});
- });
+ let bcOffsetTop = $('.swh-browse-bread-crumbs').offset().top;
+ $('.swh-browse-bread-crumbs').css('position', 'absolute');
+ $('.swh-browse-bread-crumbs').offset({'left': bcOffsetLeft, 'top': bcOffsetTop});
+ });
- $('.swh-metadata-toggler').popover({
- boundary: 'viewport',
- container: 'body',
- html: true,
- template: `
+ $('.swh-metadata-toggler').popover({
+ boundary: 'viewport',
+ container: 'body',
+ html: true,
+ template: `
`,
- content: function() {
- var content = $(this).attr('data-popover-content');
- return $(content).children('.popover-body').html();
- },
- title: function() {
- var title = $(this).attr('data-popover-content');
- return $(title).children('.popover-heading').html();
- },
- offset: '50vh'
- });
-
- $('.swh-vault-menu a.dropdown-item').on('click', e => {
- $('.swh-metadata-toggler').popover('hide');
- });
-
- $('.swh-metadata-toggler').on('show.bs.popover', () => {
- $('.swh-vault-menu .dropdown-menu').hide();
- });
-
- $('.swh-actions-dropdown').on('hide.bs.dropdown', () => {
- $('.swh-vault-menu .dropdown-menu').hide();
- $('.swh-metadata-toggler').popover('hide');
- });
-
- $('body').on('click', e => {
- if ($(e.target).parents('.swh-metadata').length) {
- e.stopPropagation();
- }
- });
+ content: function() {
+ var content = $(this).attr('data-popover-content');
+ return $(content).children('.popover-body').html();
+ },
+ title: function() {
+ var title = $(this).attr('data-popover-content');
+ return $(title).children('.popover-heading').html();
+ },
+ offset: '50vh'
+ });
- $(`.browse-${page}-item`).addClass('active');
- $(`.browse-${page}-link`).addClass('active');
+ $('.swh-vault-menu a.dropdown-item').on('click', e => {
+ $('.swh-metadata-toggler').popover('hide');
+ });
- $(`.browse-main-link`).click(event => {
- let lastBrowsePage = sessionStorage.getItem('last-browse-page');
- if (lastBrowsePage) {
- event.preventDefault();
- window.location = lastBrowsePage;
- }
- });
+ $('.swh-metadata-toggler').on('show.bs.popover', () => {
+ $('.swh-vault-menu .dropdown-menu').hide();
+ });
- window.onunload = () => {
- if (page === 'main') {
- sessionStorage.setItem('last-browse-page', window.location);
- }
- };
+ $('.swh-actions-dropdown').on('hide.bs.dropdown', () => {
+ $('.swh-vault-menu .dropdown-menu').hide();
+ $('.swh-metadata-toggler').popover('hide');
+ });
+ $('body').on('click', e => {
+ if ($(e.target).parents('.swh-metadata').length) {
+ e.stopPropagation();
+ }
});
-}
+});
diff --git a/swh/web/assets/src/bundles/browse/browse.css b/swh/web/assets/src/bundles/browse/browse.css
index ce41c915..106ffc2a 100644
--- a/swh/web/assets/src/bundles/browse/browse.css
+++ b/swh/web/assets/src/bundles/browse/browse.css
@@ -1,110 +1,106 @@
/**
* Copyright (C) 2018 The Software Heritage developers
* See the AUTHORS file at the top-level directory of this distribution
* License: GNU Affero General Public License version 3, or any later version
* See top-level LICENSE file for more information
*/
-.navbar-header a,
-ul.dropdown-menu a,
-ul.navbar-nav a {
- border-bottom-style: none;
- color: #323232;
- font-weight: 700;
-}
+
.swh-browse-nav li a {
border-radius: 4px;
}
-.nav-link.active {
- background-color: #e7e7e7;
-}
-
.scrollable-menu {
max-height: 180px;
overflow-x: hidden;
}
.swh-corner-ribbon {
width: 200px;
background: #e43;
position: absolute;
text-align: center;
line-height: 50px;
letter-spacing: 1px;
color: #f0f0f0;
box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
top: 55px;
right: -50px;
left: auto;
transform: rotate(45deg);
z-index: 2000;
}
.swh-loading {
display: none;
+ text-align: center;
+ margin-top: 10px;
}
.swh-loading.show {
display: block;
}
.swh-metadata-table-row {
border-top: 1px solid #ddd !important;
}
.swh-metadata-table-key {
min-width: 200px;
max-width: 200px;
width: 200px;
}
.swh-metadata-table-value pre {
white-space: pre-wrap;
}
.swh-table-even-odd th {
border-top: none;
}
.swh-table-even-odd tr:nth-child(even) {
background-color: #f5f5f5;
}
.swh-table-even-odd tr:nth-child(odd) {
background-color: #fff;
}
.swh-table-cell-text-overflow {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.swh-directory-table {
margin-bottom: 0;
}
.swh-directory-table td {
border-top: 1px solid #ddd !important;
}
.swh-title-color {
color: #e20026;
}
.swh-log-entry-message {
min-width: 460px;
max-width: 460px;
width: 460px;
}
.swh-metadata {
max-height: 50vh;
max-width: 41vw;
overflow-y: auto;
overflow-x: auto;
padding: 0;
padding-right: 1.4em;
-}
\ No newline at end of file
+}
+
+.swh-search-pagination {
+ margin-top: 5px;
+}
diff --git a/swh/web/assets/src/bundles/vendors/index.js b/swh/web/assets/src/bundles/vendors/index.js
index 749a6771..d14e735f 100644
--- a/swh/web/assets/src/bundles/vendors/index.js
+++ b/swh/web/assets/src/bundles/vendors/index.js
@@ -1,28 +1,31 @@
/**
* Copyright (C) 2018 The Software Heritage developers
* See the AUTHORS file at the top-level directory of this distribution
* License: GNU Affero General Public License version 3, or any later version
* See top-level LICENSE file for more information
*/
// vendors bundles centralizing assets used in all swh-web applications
// polyfills in order to use advanded js features (like Promise or fetch)
// in older browsers
import 'babel-polyfill';
import 'whatwg-fetch';
// jquery and bootstrap
import 'jquery';
import 'bootstrap-loader/lib/bootstrap.loader?configFilePath=../../../swh/web/assets/config/.bootstraprc!bootstrap-loader/no-op.js';
// jquery datatables
import 'datatables.net';
import 'datatables.net-bs4/css/dataTables.bootstrap4.css';
import './datatables.css';
+// admin-lte scripts
+import 'admin-lte';
+
// web fonts
import 'typeface-alegreya';
import 'typeface-alegreya-sans';
import 'font-awesome/css/font-awesome.css';
import 'octicons/build/font/octicons.css';
diff --git a/swh/web/assets/src/bundles/webapp/breadcrumbs.css b/swh/web/assets/src/bundles/webapp/breadcrumbs.css
index 3c5cc50e..e9dbdb76 100644
--- a/swh/web/assets/src/bundles/webapp/breadcrumbs.css
+++ b/swh/web/assets/src/bundles/webapp/breadcrumbs.css
@@ -1,31 +1,32 @@
/**
* Copyright (C) 2018 The Software Heritage developers
* See the AUTHORS file at the top-level directory of this distribution
* License: GNU Affero General Public License version 3, or any later version
* See top-level LICENSE file for more information
*/
.bread-crumbs {
display: inline-block;
- overflow: hidden;
+ /* overflow: hidden; */
color: rgba(0, 0, 0, 0.55);
}
.bread-crumbs ul {
list-style-type: none;
+ height: 100%;
}
.bread-crumbs li {
float: left;
list-style-type: none;
}
.bread-crumbs a {
color: rgba(0, 0, 0, 0.75);
border-bottom-style: none;
}
.bread-crumbs a:hover {
color: rgba(0, 0, 0, 0.85);
text-decoration: underline;
}
diff --git a/swh/web/assets/src/bundles/webapp/index.js b/swh/web/assets/src/bundles/webapp/index.js
index fbc386ee..dfeb6e8f 100644
--- a/swh/web/assets/src/bundles/webapp/index.js
+++ b/swh/web/assets/src/bundles/webapp/index.js
@@ -1,20 +1,22 @@
/**
* Copyright (C) 2018 The Software Heritage developers
* See the AUTHORS file at the top-level directory of this distribution
* License: GNU Affero General Public License version 3, or any later version
* See top-level LICENSE file for more information
*/
// webapp entrypoint bundle centralizing global custom stylesheets
// and utility js modules used in all swh-web applications
// explicitely import the vendors bundle
import '../vendors';
// global swh-web custom stylesheets
import './webapp.css';
import './breadcrumbs.css';
+export * from './webapp-utils';
+
// utility js modules
export * from './code-highlighting';
export * from './markdown-rendering';
diff --git a/swh/web/assets/src/bundles/webapp/webapp-utils.js b/swh/web/assets/src/bundles/webapp/webapp-utils.js
new file mode 100644
index 00000000..a67dc813
--- /dev/null
+++ b/swh/web/assets/src/bundles/webapp/webapp-utils.js
@@ -0,0 +1,53 @@
+$(document).ready(() => {
+ // restore previous sidebar state (collapsed/expanded)
+ let collapseSidebar = false;
+ let previousSidebarState = localStorage.getItem('swh-sidebar-collapsed');
+ if (previousSidebarState !== undefined) {
+ collapseSidebar = JSON.parse(previousSidebarState);
+ }
+ if (collapseSidebar) {
+ // hack to avoid animated transition for collasping sidebar
+ // when loading a page
+ let sidebarTransition = $('.main-sidebar, .main-sidebar:before').css('transition');
+ let sidebarEltsTransition = $('.sidebar .nav-link p, .main-sidebar .brand-text, .sidebar .user-panel .info').css('transition');
+ $('.main-sidebar, .main-sidebar:before').css('transition', 'none');
+ $('.sidebar .nav-link p, .main-sidebar .brand-text, .sidebar .user-panel .info').css('transition', 'none');
+ $('body').addClass('sidebar-collapse');
+ // restore transitions for user navigation
+ setTimeout(() => {
+ $('.main-sidebar, .main-sidebar:before').css('transition', sidebarTransition);
+ $('.sidebar .nav-link p, .main-sidebar .brand-text, .sidebar .user-panel .info').css('transition', sidebarEltsTransition);
+ });
+ }
+
+ // redirect to last browse page if any when clicking on the 'Browse' entry
+ // in the sidebar
+ $(`.swh-browse-link`).click(event => {
+ let lastBrowsePage = sessionStorage.getItem('last-browse-page');
+ if (lastBrowsePage) {
+ event.preventDefault();
+ window.location = lastBrowsePage;
+ }
+ });
+});
+
+export function initPage(page) {
+
+ $(document).ready(() => {
+ // set relevant sidebar link to page active
+ $(`.swh-${page}-item`).addClass('active');
+ $(`.swh-${page}-link`).addClass('active');
+
+ // triggered when unloading the current page
+ window.onunload = () => {
+ // backup sidebar state (collapsed/expanded)
+ let sidebarCollapsed = $('body').hasClass('sidebar-collapse');
+ localStorage.setItem('swh-sidebar-collapsed', JSON.stringify(sidebarCollapsed));
+ // backup current browse page
+ if (page === 'browse') {
+ sessionStorage.setItem('last-browse-page', window.location);
+ }
+ };
+
+ });
+}
diff --git a/swh/web/assets/src/bundles/webapp/webapp.css b/swh/web/assets/src/bundles/webapp/webapp.css
index 02bad88f..71206385 100644
--- a/swh/web/assets/src/bundles/webapp/webapp.css
+++ b/swh/web/assets/src/bundles/webapp/webapp.css
@@ -1,286 +1,331 @@
/**
* Copyright (C) 2018 The Software Heritage developers
* See the AUTHORS file at the top-level directory of this distribution
* License: GNU Affero General Public License version 3, or any later version
* See top-level LICENSE file for more information
*/
html {
height: 100%;
overflow-x: hidden;
}
body {
min-height: 100%;
margin: 0;
position: relative;
padding-bottom: 120px;
}
a {
border-bottom-style: none;
outline: none;
}
code {
background-color: #f9f2f4;
}
pre code {
background-color: transparent;
}
footer {
background-color: #262626;
color: #fff;
font-size: 0.8rem;
position: absolute;
bottom: 0;
width: 100%;
padding-top: 20px;
padding-bottom: 20px;
}
footer a,
footer a:visited {
color: #fecd1b;
}
footer a:hover {
text-decoration: underline;
}
pre {
background-color: #f5f5f5;
border: 1px solid #ccc;
border-radius: 4px;
padding: 9.5px;
font-size: 0.8rem;
}
.btn.active {
background-color: #e7e7e7;
}
.card {
margin-bottom: 5px !important;
overflow-x: auto;
}
.navbar-brand {
padding: 5px;
margin-right: 0;
}
.table {
margin-bottom: 0;
}
.swh-web-app-link a {
text-decoration: none;
outline: none;
border: none;
}
.swh-web-app-link:hover {
background-color: #efeff2;
}
.table > thead > tr > th {
border-top: none;
border-bottom: 1px solid #e20026;
}
.table > tbody > tr > td {
border-style: none;
}
.sitename .first-word,
.sitename .second-word {
color: rgba(0, 0, 0, 0.75);
font-weight: normal;
font-size: 1.2rem;
}
.sitename .first-word {
font-family: 'Alegreya Sans', sans-serif;
}
.sitename .second-word {
font-family: 'Alegreya', serif;
}
.swh-api-doc-route-upcoming > td,
.swh-api-doc-route-upcoming > td > a {
font-size: 90%;
}
.swh-api-doc-route-deprecated > td,
.swh-api-doc-route-deprecated > td > a {
color: red;
}
.swh-api-doc p {
margin-bottom: 0;
}
.swh-api-doc dt {
text-align: right;
}
.swh-counter {
font-size: 150%;
}
.swh-http-error {
margin: 0 auto;
text-align: center;
}
.swh-http-error-head {
color: #2d353c;
font-size: 30px;
}
.swh-http-error-code {
bottom: 60%;
color: #2d353c;
font-size: 96px;
line-height: 80px;
margin-bottom: 10px !important;
}
.swh-http-error-desc {
font-size: 12px;
color: #647788;
text-align: center;
}
.swh-http-error-desc pre {
display: inline-block;
text-align: left;
max-width: 800px;
white-space: pre-wrap;
}
.popover {
max-width: 100%;
}
.modal {
text-align: center;
padding: 0 !important;
}
.modal::before {
content: '';
display: inline-block;
height: 100%;
vertical-align: middle;
margin-right: -4px;
}
.modal-dialog {
display: inline-block;
text-align: left;
vertical-align: middle;
}
.dropdown-submenu {
position: relative;
}
.dropdown-submenu .dropdown-menu {
top: 0;
left: -100%;
margin-top: -5px;
margin-left: -2px;
}
.dropdown-item:hover,
.dropdown-item:focus {
background-color: rgba(0, 0, 0, 0.1);
}
a.dropdown-left::before {
content: "\f0d9";
font-family: 'FontAwesome';
display: block;
width: 20px;
height: 20px;
float: left;
margin-left: 0;
}
-#swh-navbar-collapse {
+#swh-navbar {
border-top-style: none;
border-left-style: none;
border-right-style: none;
border-bottom: 5px solid;
border-image: linear-gradient(to right, rgb(226, 0, 38) 0%, rgb(254, 205, 27) 100%) 1 1 1 1;
width: 100%;
padding: 5px;
margin-bottom: 20px;
margin-top: 30px;
}
#back-to-top {
display: initial;
position: fixed;
bottom: 30px;
right: 30px;
z-index: 10;
}
#back-to-top a img {
display: block;
width: 32px;
height: 32px;
background-size: 32px 32px;
text-indent: -999px;
overflow: hidden;
}
.swh-top-bar {
direction: ltr;
height: 30px;
position: fixed;
top: 0;
left: 0;
width: 100%;
min-width: 600px;
z-index: 99999;
background-color: #262626;
color: #fff;
text-align: center;
font-size: 14px;
}
.swh-top-bar ul {
margin-top: 4px;
margin-left: 28px;
}
.swh-top-bar li {
display: inline;
margin-left: 10px;
margin-right: 10px;
}
.swh-top-bar a,
.swh-top-bar a:visited {
color: #fecd1b;
}
.swh-top-bar a.swh-current-site,
.swh-top-bar a.swh-current-site:visited {
color: #e20026;
}
.swh-donate-link {
border: 1px solid #fecd1b;
background-color: #e20026;
color: white !important;
padding: 3px;
border-radius: 3px;
+}
+
+.swh-navbar-content h4 {
+ padding-top: 7px;
+}
+
+.swh-navbar-content .bread-crumbs {
+ display: block;
+ margin-left: -40px;
+}
+
+.swh-navbar-content .bread-crumbs li.bc-no-root {
+ padding-top: 7px;
+}
+
+.main-sidebar {
+ margin-top: 30px;
+}
+
+.content-wrapper {
+ background: none;
+}
+
+.brand-image {
+ max-height: 40px;
+}
+
+.brand-link {
+ padding-top: 18.5px;
+ padding-bottom: 18px;
+ padding-left: 4px;
+ border-bottom: 5px solid #e20026 !important;
+}
+
+.navbar-header a,
+ul.dropdown-menu a,
+ul.navbar-nav a,
+ul.nav-sidebar a {
+ border-bottom-style: none;
+ color: #323232;
+}
+
+.swh-sidebar .nav-link.active {
+ color: #323232 !important;
+ background-color: #e7e7e7 !important;
}
\ No newline at end of file
diff --git a/swh/web/static/img/swh-api.png b/swh/web/static/img/swh-api.png
index 29da830a..82448f1f 100644
Binary files a/swh/web/static/img/swh-api.png and b/swh/web/static/img/swh-api.png differ
diff --git a/swh/web/static/img/swh-browse.png b/swh/web/static/img/swh-browse.png
index 19f39701..afa483cf 100644
Binary files a/swh/web/static/img/swh-browse.png and b/swh/web/static/img/swh-browse.png differ
diff --git a/swh/web/static/img/swh-vault.png b/swh/web/static/img/swh-vault.png
new file mode 100644
index 00000000..61c23917
Binary files /dev/null and b/swh/web/static/img/swh-vault.png differ
diff --git a/swh/web/templates/api-endpoints.html b/swh/web/templates/api-endpoints.html
index 399156a2..77f6f916 100644
--- a/swh/web/templates/api-endpoints.html
+++ b/swh/web/templates/api-endpoints.html
@@ -1,84 +1,83 @@
{% extends "layout.html" %}
{% comment %}
Copyright (C) 2015-2018 The Software Heritage developers
See the AUTHORS file at the top-level directory of this distribution
License: GNU Affero General Public License version 3, or any later version
See top-level LICENSE file for more information
{% endcomment %}
{% load swh_templatetags %}
{% block title %} Endpoints – Software Heritage API {% endblock %}
+{% block navbar-content %}
+
+{% endblock %}
+
{% block content %}
-
-
-
Below you can find a list of the available endpoints for version 1 of the
Software Heritage API. For a more general introduction please refer to
the API overview .
Endpoints marked "available" are considered stable for the current version
of the API; endpoints marked "upcoming" are work in progress that will be
stabilized in the near future.
{% for route, doc in doc_routes %}
{{ route }}
{% endfor %}
Endpoint
Status
Description
{% for route, doc in doc_routes %}
{% if doc.tags|length > 0 %}
{% url doc.route_view_name %}
{{ doc.tags|join:', ' }}
{% else %}
{% url doc.route_view_name %}
available
{% endif %}
{{ doc.doc_intro | safe_docstring_display | safe }}
{% endfor %}
-
-
{% endblock %}
diff --git a/swh/web/templates/api.html b/swh/web/templates/api.html
index 60d3d225..cde81b5b 100644
--- a/swh/web/templates/api.html
+++ b/swh/web/templates/api.html
@@ -1,23 +1,23 @@
{% extends "layout.html" %}
{% comment %}
Copyright (C) 2015-2018 The Software Heritage developers
See the AUTHORS file at the top-level directory of this distribution
License: GNU Affero General Public License version 3, or any later version
See top-level LICENSE file for more information
{% endcomment %}
{% block title %} Overview – Software Heritage API {% endblock %}
+{% block navbar-content %}
+
Web API
+{% endblock %}
+
{% block content %}
-
-
-
-
- {% include 'includes/apidoc-header.html' %}
-
+
+ {% include 'includes/apidoc-header.html' %}
-
+
{% endblock %}
diff --git a/swh/web/templates/apidoc.html b/swh/web/templates/apidoc.html
index 6d8ac1aa..de129272 100644
--- a/swh/web/templates/apidoc.html
+++ b/swh/web/templates/apidoc.html
@@ -1,161 +1,159 @@
{% extends "layout.html" %}
{% comment %}
Copyright (C) 2015-2018 The Software Heritage developers
See the AUTHORS file at the top-level directory of this distribution
License: GNU Affero General Public License version 3, or any later version
See top-level LICENSE file for more information
{% endcomment %}
{% load swh_templatetags %}
{% load render_bundle from webpack_loader %}
{% block title %}{{ heading }} – Software Heritage API {% endblock %}
+{% block navbar-content %}
+
+
+
+{% endblock %}
+
{% block content %}
-
-
-
- {% if docstring %}
-
-
Description
- {{ docstring | safe_docstring_display | safe }}
-
- {% endif %}
- {% if response_data %}
-
-
Request
-
{{ request.method }} {{ request.absolute_uri }}
-
-
Response
- {% if status_code != 200 %}
-
Status Code
-
{{ status_code }}
- {% endif %}
- {% if headers_data %}
-
Headers
- {% for header_name, header_value in headers_data.items %}
-
{{ header_name }} {{ header_value | urlize_header_links | safe }}
- {% endfor %}
- {% endif %}
-
Body
-
- {{ response_data | urlize_links_and_mails | safe }}
-
-
- {% endif %}
-
- {% if urls and urls|length > 0 %}
-
-
-
-
- URL
- Allowed Methods
-
-
-
- {% for url in urls %}
-
- {{ url.rule }}
- {{ url.methods | dictsort:0 | join:', ' }}
-
- {% endfor %}
-
-
-
-
- {% endif %}
- {% if args and args|length > 0 %}
-
-
Arguments
- {% for arg in args %}
-
- {{ arg.name }}: {{ arg.type }}
- {{ arg.doc | safe_docstring_display | safe }}
-
- {% endfor %}
-
-
- {% endif %}
- {% if params and params|length > 0 %}
-
-
Parameters
- {% for param in params %}
-
- {{ param.name }}: {{ param.type }}
- {{ param.doc | safe_docstring_display | safe }}
-
- {% endfor %}
-
-
- {% endif %}
- {% if headers and headers|length > 0 %}
-
+{% if docstring %}
+
+
Description
+ {{ docstring | safe_docstring_display | safe }}
+
+{% endif %}
+{% if response_data %}
+
+
Request
+
{{ request.method }} {{ request.absolute_uri }}
+
Response
+ {% if status_code != 200 %}
+
Status Code
+
{{ status_code }}
{% endif %}
- {% if returns and returns|length > 0 %}
-
-
Returns
- {% for return in returns %}
-
- {{ return.type }}
- {{ return.doc | safe_docstring_display | safe }}
-
- {% endfor %}
-
-
- {% endif %}
- {% if excs and excs|length > 0 %}
-
-
Errors
- {% for exc in excs %}
-
- {{ exc.exc }}
- {{ exc.doc | safe_docstring_display | safe }}
-
- {% endfor %}
-
-
+ {% if headers_data %}
+
Headers
+ {% for header_name, header_value in headers_data.items %}
+
{{ header_name }} {{ header_value | urlize_header_links | safe }}
+ {% endfor %}
{% endif %}
- {% if examples and examples|length > 0 %}
-
-
Examples
- {% for example in examples %}
-
-
-
- {{ example }}
-
-
+
Body
+
+ {{ response_data | urlize_links_and_mails | safe }}
+
+
+{% endif %}
+
+{% if urls and urls|length > 0 %}
+
+
+
+
+ URL
+ Allowed Methods
+
+
+
+ {% for url in urls %}
+
+ {{ url.rule }}
+ {{ url.methods | dictsort:0 | join:', ' }}
+
{% endfor %}
-
- {% endif %}
+
+
+
+
+{% endif %}
+{% if args and args|length > 0 %}
+
+
Arguments
+ {% for arg in args %}
+
+ {{ arg.name }}: {{ arg.type }}
+ {{ arg.doc | safe_docstring_display | safe }}
+
+ {% endfor %}
+
+
+{% endif %}
+{% if params and params|length > 0 %}
+
+
Parameters
+ {% for param in params %}
+
+ {{ param.name }}: {{ param.type }}
+ {{ param.doc | safe_docstring_display | safe }}
+
+ {% endfor %}
+
+
+{% endif %}
+{% if headers and headers|length > 0 %}
+
+
+{% endif %}
+{% if returns and returns|length > 0 %}
+
+
Returns
+ {% for return in returns %}
+
+ {{ return.type }}
+ {{ return.doc | safe_docstring_display | safe }}
+
+ {% endfor %}
+
+
+{% endif %}
+{% if excs and excs|length > 0 %}
+
+
Errors
+ {% for exc in excs %}
+
+ {{ exc.exc }}
+ {{ exc.doc | safe_docstring_display | safe }}
+
+ {% endfor %}
+
+
+{% endif %}
+{% if examples and examples|length > 0 %}
+
+
Examples
+ {% for example in examples %}
+
+
+
+ {{ example }}
+
+
+ {% endfor %}
-
+{% endif %}
{% endblock %}
diff --git a/swh/web/templates/browse-help.html b/swh/web/templates/browse-help.html
index 6abd9dcf..e6c49910 100644
--- a/swh/web/templates/browse-help.html
+++ b/swh/web/templates/browse-help.html
@@ -1,194 +1,189 @@
{% extends "browse-layout.html" %}
{% comment %}
Copyright (C) 2017-2018 The Software Heritage developers
See the AUTHORS file at the top-level directory of this distribution
License: GNU Affero General Public License version 3, or any later version
See top-level LICENSE file for more information
{% endcomment %}
-{% block browse-content %}
-
-
-
-
-
-
-
Overview
-
-
- This web application aims to provide HTML views to easily navigate in the Software Heritage archive. This is an ongoing development
- and new features and improvements will be progressively added over time.
-
-
-
URI scheme
-
-
- The current URI scheme of that web application is described below and depends on the type of Software Heritage object to
- browse. Its exhaustive documentation can be consulted from the official
-
- Software Heritage development documentation
-
-
-
-
Context-independent browsing
-
-
- Context-independent URLs provide information about objects (e.g., revisions, directories, contents, persons, …), independently
- of the contexts where they have been found (e.g., specific software origins, branches, commits, …).
-
-
-
- Below are some examples of endpoints used to just render the corresponding information for user consumption:
-
+{% block navbar-content %}
+
How to browse the archive ?
+{% endblock %}
+{% block browse-content %}
+
+
+
Overview
+
+
+ This web application aims to provide HTML views to easily navigate in the Software Heritage archive. This is an ongoing development
+ and new features and improvements will be progressively added over time.
+
+
+
URI scheme
+
+
+ The current URI scheme of that web application is described below and depends on the type of Software Heritage object to
+ browse. Its exhaustive documentation can be consulted from the official
+
+ Software Heritage development documentation
+
+
+
+
Context-independent browsing
+
+
+ Context-independent URLs provide information about objects (e.g., revisions, directories, contents, persons, …), independently
+ of the contexts where they have been found (e.g., specific software origins, branches, commits, …).
+
+
+
+ Below are some examples of endpoints used to just render the corresponding information for user consumption:
+
+
+
+
+
+ Where hyperlinks are created when browsing these kind of endpoints, they always point to other context-independent browsing
+ URLs.
+
+
+
Context-dependent browsing
+
+
+ Context-dependent URLs provide information about objects, limited to specific contexts where the objects have been found.
+
+
+
+ Currently, browsing the Software Heritage objects in the context of an
+ origin is available. Below are some examples of such endpoints:
+
+
+
+
+ Display information about the visits of a software
+ origin :
-
-
- Where hyperlinks are created when browsing these kind of endpoints, they always point to other context-independent browsing
- URLs.
-
-
- Context-dependent browsing
-
-
- Context-dependent URLs provide information about objects, limited to specific contexts where the objects have been found.
-
-
-
- Currently, browsing the Software Heritage objects in the context of an
- origin is available. Below are some examples of such endpoints:
-
-
+
+
+ Display the latest archived
+ snapshot for a software
+ origin :
-
- Search software origins to browse
-
- In order to facilitate the browsing of the archive and generate relevant entry points to it, a
- search interface is available. Currently, it enables to search software origins from the URLs they were retrieved
- from. More search criteria will be added in the future.
-
-
-
+
+
+ Display a
+ content from an
+ origin :
+
+ {% url 'browse-origin-content' origin_type='git' origin_url='https://github.com/git/git' path='git.c' %}
+
+
+
+ Display a
+ directory from an
+ origin :
+
+
+ {% url 'browse-origin-directory' origin_type='git' origin_url='https://github.com/torvalds/linux' path='net/ethernet' %}
+
+
+
+ Display the
+ revision history (aka the commit log) from an
+ origin :
+
+
+ {% url 'browse-origin-log' origin_type='git' origin_url='https://github.com/Kitware/CMake' %}
+
+
+
+
+
Search software origins to browse
+
+In order to facilitate the browsing of the archive and generate relevant entry points to it, a
+
search interface is available. Currently, it enables to search software origins from the URLs they were retrieved
+from. More search criteria will be added in the future.
{% endblock %}
\ No newline at end of file
diff --git a/swh/web/templates/browse-layout.html b/swh/web/templates/browse-layout.html
index a64a3b0a..ed7302c7 100644
--- a/swh/web/templates/browse-layout.html
+++ b/swh/web/templates/browse-layout.html
@@ -1,40 +1,23 @@
{% extends "layout.html" %}
{% comment %}
Copyright (C) 2017-2018 The Software Heritage developers
See the AUTHORS file at the top-level directory of this distribution
License: GNU Affero General Public License version 3, or any later version
See top-level LICENSE file for more information
{% endcomment %}
{% load swh_templatetags %}
{% load render_bundle from webpack_loader %}
{% block title %}{{ heading }} – Software Heritage archive {% endblock %}
{% block header %}
{% render_bundle 'browse' %}
{% render_bundle 'vault' %}
{% endblock %}
-{% block navbar-content %}
-
-{% endblock %}
-
{% block content %}
Alpha version
{% block browse-content %}{% endblock %}
{% endblock %}
diff --git a/swh/web/templates/browse-search.html b/swh/web/templates/browse-search.html
index de715f6f..4053adcc 100644
--- a/swh/web/templates/browse-search.html
+++ b/swh/web/templates/browse-search.html
@@ -1,62 +1,61 @@
{% extends "browse-layout.html" %}
{% comment %}
Copyright (C) 2017-2018 The Software Heritage developers
See the AUTHORS file at the top-level directory of this distribution
License: GNU Affero General Public License version 3, or any later version
See top-level LICENSE file for more information
{% endcomment %}
{% load static %}
+{% block navbar-content %}
+
Search software origins to browse
+{% endblock %}
+
{% block browse-content %}
-
-